<?php

namespace App\Http\Requests\Api\Admin;

use App\Http\Requests\Api\FormRequest;

class AdminUserPsdRequest extends FormRequest
{
    public function rules()
    {
        return [
            'oldPassword' => ['required', 'password:admin'],
            'newPassword' => ['required', 'max:16', 'min:6'],
            'confirmNewPassword' => ['same:newPassword'],
        ];
    }

    public function messages()
    {
        return [
            'oldPassword.password' => '原密码不正确',
            'newPassword.required' => '新密码不能为空',
            'newPassword.max' => '密码格式不正确',
            'newPassword.min' => '密码格式不正确',
            'confirmNewPassword.same' => '确认密码与新密码不一样',
        ];
    }

}
